#include <iostream>
using namespace std;
int Z(int m);
int main ()
{int n,m,b,a[10000];
 cin>>n;
 for (int i=1;i<=n;i++)
    {cin>>m;
     a[i]=Z(m);
     
     }
 for (int i=1;i<=n;i++)
    {cout<<a[i]<<endl;}
 system("pause");
 return 0;
}

int Z(int m)
{int x=1;
 for (int i=1;i<=m;i++)
   {x=x*i;}
 return x;
}
